package protocol;

import server.NodeInfo;

public class SchemaException extends AttachingNodeException {
	private static final long serialVersionUID = 1L;
	private NodeInfo info;
	private String details;
	
	public SchemaException(NodeInfo info, String details) {
		super(info, "New node has not matching schema");
		this.info = info;
		this.details = details;
	}

	@Override
	public String getMessage() {	
		return "Database has not matching schema\n" +
			   "Details: " + details + "\n" +
			   "Database name: " + info.getDbName() + "\n" + 
			   "Database server IP: " + info.getIP() + "\n";
	}
}
